:ruby
  if nature = f.object.nature
    f.object.name ||= nature.name
    f.object.unit_name ||= Nomen::Variety[nature.variety].human_name
    nature.frozen_indicators.each do |indicator|
      unless f.object.readings.detect { |r| r.indicator_name.to_s == indicator.name.to_s }
        f.object.readings.build(indicator_name: indicator.name, indicator_datatype: indicator.datatype)
      end
    end
  end

= field_set do
  - if f.object.new_record? and nature.nil?
    = f.referenced_association :nature
  - else
    = f.association :nature, as: :hidden
  = f.variety scope: nature, child_scope: f.object.products
  = f.input :name
  = f.input :work_number
  = f.input :gtin
  = f.input :active
  = f.input :unit_name
  = f.input :france_maaid
  = f.picture
  = f.custom_fields

- if f.object.readings.any?
  = field_set(:indicators) do
    = f.nested_association(:readings, new: false)

- if f.object.of_variety? :equipment
  = field_set(:components) do
    = f.nested_association(:components, collection: f.object.components.select { |c| c.parent_id.nil? })



